 	import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.util.ArrayList;

import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JScrollPane;

import Jama.Matrix;


public class MainMethod {
	public static void main(String[]args){
		// WILL NEED TO CHANGE DIRECTORY DEPENDENT ON SYSTEMS
		//ImageHandler ih = new ImageHandler("C:/Users/Justin/workspace/Math 2605/src/calc3.jpg", 200, 300);
		ImageHandler ih = new ImageHandler("C:/Users/Summit/Desktop/GT Classes/CS 1332 - Fall 2010/Math 2605/src/calc3.jpg", 200,300);
		Matrix A = ih.getPixel();
		//ih.matrixtoString();
		EigenOperations eo = new EigenOperations();
		//ArrayList list = eo.SVD(A, 2);
		//ArrayList list1 = eo.SVD(A,5);
		ArrayList list2 = eo.SVD(A,10);
		ArrayList hh = eo.Householder(A);
		Matrix B = ((Matrix) hh.get(0)).times((Matrix) hh.get(1));
		JFrame f = new JFrame();
        
        f.addWindowListener(new WindowAdapter(){
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
                }
            });
        
        ih.setImageMatrix(B);
        ih.matrixToImage(300,200);
        f.add(new JScrollPane(ih));
        f.setSize(ih.getWidth(),ih.getHeight());
        f.setLocation(200,200);
        f.setPreferredSize(new Dimension(400, 300));
        f.pack();
        f.setVisible(true);
		
		System.out.println("Sigma 1: " + list2.get(1));
		System.out.println("Sigma k+1: " + list2.get(2));
	}
}
